package br.cns;

import org.junit.Test;

import br.cns.MetricHelper;
import br.cns.TMetric;

public class NaturalConnectivityTest {

	@Test
	public void testCalculateNet1() {
		int[] posCanhao = {-1, -1}; 
		System.out.println(posCanhao[1]);
		int[][] net = new int[][]{
				{0, 1, 1, 0, 0, 0},
				{1, 0, 0, 1, 0, 0},
				{1, 0, 0, 1, 0, 0},
				{0, 1, 1, 0, 1, 1},
				{0, 0, 0, 1, 0, 1},
				{0, 0, 0, 1, 1, 0}};
		System.out.println(MetricHelper.getInstance().calculate(TMetric.NATURAL_CONNECTIVITY, net));
		assert((int)(MetricHelper.getInstance().calculate(TMetric.NATURAL_CONNECTIVITY, net)*10000) == 10878);
	}
	
	@Test
	public void testCalculateNet2() {
		int[][] net = new int[][]{
				{0, 1, 1, 0, 0, 0},
				{1, 0, 1, 1, 0, 0},
				{1, 1, 0, 1, 0, 0},
				{0, 1, 1, 0, 1, 1},
				{0, 0, 0, 1, 0, 1},
				{0, 0, 0, 1, 1, 0}};
		System.out.println(MetricHelper.getInstance().calculate(TMetric.NATURAL_CONNECTIVITY, net));
		assert((int)(MetricHelper.getInstance().calculate(TMetric.NATURAL_CONNECTIVITY, net)*10000) == 13508);
	}
}
